<?php
class Admin_Form_Search_Contact extends Apps_Plugin_Grid_Search_Abstract {
    public function preInit() {
        $advancedCriteria = array(
            'name' => array(
                    'contact.full_name',
                    self::$criteriaStringLike,
                    array(
                            'element'  => self::ELEMENT_TEXT,
                            'label'    => 'Người gửi',
                    )
            ),
            'email' => array(
            		'contact.email',
            		self::$criteriaStringLike,
					array(
							'element'	   => self::ELEMENT_TEXT,
							'label'		   => 'Email',
					)
            ),
            'subject' => array(
            		'contact.subject',
            		self::$criteriaStringLike,
					array(
							'element'	   => self::ELEMENT_TEXT,
							'label'		   => 'Tiêu đề',
					)
            ),
            'message' => array(
            		'contact.message',
            		self::$criteriaStringLike,
					array(
							'element'	   => self::ELEMENT_TEXT,
							'label'		   => 'Nội dung',
					)
            )
        );

        $simpleCriteria = array(
        		array('contact.id LIKE ?', '%%%s%%'),
        		array('contact.full_name LIKE ?', '%%%s%%'),
        		array('contact.email LIKE ?', '%%%s%%'),
        		array('contact.subject LIKE ?', '%%%s%%'),
        		array('contact.message LIKE ?', '%%%s%%')
        );

        $this->setAdvCriteria($advancedCriteria);
        $this->setSplCriteria($simpleCriteria);
    }
}